##############################
#   enemy 
#   by Jerry Yang      
#   UUZ0226            
#############################
import pygame
from settings import Settings
from pygame.sprite import Sprite


class Enemy(Sprite):
    def __init__(self, ai_settings,screen,enemytype):
        """初始化并设置其初始位置"""
        super(Enemy, self).__init__()
        # 加载图像并获取其外接矩形
        self.filepath = ai_settings.filepath
        self.enemytype = enemytype
        self.screen = screen
        self.image = pygame.image.load(self.filepath+self.enemytype+'.png')
        self.rect = self.image.get_rect()
        self.screen_rect = screen.get_rect()
        self.rect.centerx = self.screen_rect.centerx
        self.rect.top = self.screen_rect.top
        
    def blitme(self):
        """在指定位置绘制"""
        self.screen.blit(self.image, self.rect)
        
        
        



